package actionHandlers;

import cuShapes.PQShape;
import cuShapes.PQShapeEvent;

import palette.CanvasManager;
import palette.CanvasWindow;

public class CurrentShapeListener implements PQShapeListener{

	@Override
	public void PQShapeSelected(PQShapeEvent e) {
		// Uncomment the next line to see when this event is being handled.
		//System.out.println("PQShapeSelected event occured");
		((CanvasWindow) (CanvasManager.getInst().getSelectedFrame())).getShapeProperties().setShapeTable(((PQShape) e.getSource()).getShapeTable());
		((CanvasWindow) (CanvasManager.getInst().getSelectedFrame())).getShapeProperties().getShapeTable().setProperties((PQShape) e.getSource());
		((CanvasWindow) (CanvasManager.getInst().getSelectedFrame())).getShapeProperties().setView();
		((CanvasWindow) (CanvasManager.getInst().getSelectedFrame())).getShapeProperties().getPane().updateUI();
		
		((CanvasWindow) (CanvasManager.getInst().getSelectedFrame())).getShapeTree().setSelectedNode((PQShape) e.getSource());	
	}

	@Override
	public void PQShapeDeselected(PQShapeEvent e) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void PQShapePropertyChanged(PQShapeEvent e) {
		// TODO Auto-generated method stub
		
	}
}
